home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Devices / NuBus⁄Slot Manager / Declaration ROMs / Example Vid ROM from C&D / C & D Ex VideoROM.a < prev    next >
Encoding:
Text File  |  1992-08-14  |  9.4 KB  |  265 lines  |  [TEXT/MPS ]

  1.  
  2. ;-------------------------------------------------------------------
  3. ;
  4. ;  General structure:
  5. ;
  6. ;                        [Format/Header]
  7. ;                                |
  8. ;                                |
  9. ;                      [sResource Directory]
  10. ;                            /        \
  11. ;                           /         \
  12. ;                          /              \
  13. ;                         /               \
  14. ;            [Board sResource]        [Video sResource]
  15. ;                - Primary Init.            - Driver Directory.
  16. ;                - Vendor Info.            - Parameters for 1, 2 & 4-bit modes.
  17. ;
  18. ;
  19. ;-------------------------------------------------------------------
  20.  
  21.             MACHINE        MC68020
  22.  
  23. ;=====================================================================
  24. ;    Initial Assembler Directives
  25. ;=====================================================================
  26.                 STRING     C
  27.  
  28.                 PRINT    OFF
  29.                 INCLUDE    'SysErr.a'                        ;Macintosh System equates
  30.                 INCLUDE    'SysEqu.a'                        ;Macintosh System equates
  31.                 INCLUDE    'ROMEqu.a'                        ;Declaration ROM equates
  32.                 INCLUDE    'SlotEqu.a'                        ;Slot Manager equates and macros
  33.                 INCLUDE    'TimeEqu.a'                        ;Macintosh traps
  34.                 INCLUDE    'Traps.a'                        ;Macintosh traps
  35.                 INCLUDE    'VideoEqu.a'                    ;Video driver equates
  36.                 INCLUDE    'DepVideoEqu.a'                    ;Video driver equates
  37.                 PRINT    ON
  38.  
  39. ;=====================================================================
  40. ;    BEGIN Declaration ROM
  41. ;=====================================================================
  42. VideoDeclROM    MAIN
  43.  
  44.  
  45.         WITH    VDPageInfo, SlotIntQElement
  46.  
  47.                 
  48.  
  49. ;*************************************************************
  50. ;Constants
  51. ;*************************************************************
  52.   
  53. ROMSize            EQU        $1000                    ;4K byte ROM
  54. TheBoardId        EQU        $0005                    ;the Board Id (from DTS)
  55.  
  56. ;-----------  sResource Directory                ;<Id OF>
  57. sRsrc_Board        EQU        1                        ;Board sResource {May be any number in [0..127]}
  58. sRsrc_Video        EQU        128                        ;Video sResource {May be any number in [128..254]}
  59.  
  60.  
  61.  
  62. ;=====================================================================
  63. ;        Directory 
  64. ;=====================================================================
  65. _sRsrcDir        OSLstEntry    sRsrc_Board,_sRsrc_Board        ;References the board sResource.
  66.                 OSLstEntry    sRsrc_Video,_sRsrc_Video        ;References the video sResource.
  67.                 DatLstEntry    endOfList,0                        ;End of the list.
  68.  
  69.  
  70. ;=============================================================
  71. ;            sRsrc_Board List
  72. ;=============================================================
  73. _sRsrc_Board    OSLstEntry    sRsrcType,_BoardType            ;References the sResource type.
  74.                 OSLstEntry    sRsrcName,_BoardName            ;References the sResource name.
  75.                 DatLstEntry    boardId,TheBoardId                ;The board Id.
  76.                 OSLstEntry    primaryInit,_sPInitRec            ;References the Primary init record.
  77.                 OSLstEntry    vendorInfo,_VendorInfo            ;References the Vendor information list.
  78.                 DatLstEntry    endOfList,0                        ;End of the list.
  79.  
  80. _BoardType        DC.W    CatBoard                            ;The Board sResource :    <Category>
  81.                 DC.W    TypBoard                            ;                        <Type>
  82.                 DC.W    0                                    ;                        <DrvrSw>
  83.                 DC.W    0                                    ;                        <DrvrHw>
  84. _BoardName        DC.L    'Macintosh II video card'            ;The name of the Board - should be
  85.                                                             ;the official product name
  86.                 
  87.                 
  88. ;-------------------------------------------------------------
  89. ;            Primary Init Record
  90. ;-------------------------------------------------------------
  91. _sPInitRec        DC.L    _EndsPInitRec-_sPInitRec            ;The physical Block Size
  92. ;;;                INCLUDE    'PrimaryInit.a'                        ;The Header/Code (See PrimaryInit.a)
  93. _EndsPInitRec    EQU        *                                    ;End of block
  94.                 STRING     C                                    ;Restore to 'c' string type.
  95.                 
  96.                 
  97. ;-------------------------------------------------------------
  98. ;            Vendor Info record
  99. ;-------------------------------------------------------------
  100. _VendorInfo        OSLstEntry    VendorId,_VendorId                ;References the Vendor Id.
  101.                 OSLstEntry    RevLevel,_RevLevel                ;References the Revision Level.
  102.                 OSLstEntry    PartNum,_PartNum                ;References the Part Number.
  103.                 DatLstEntry    endOfList,0                        ;End of the list.
  104.  
  105. _VendorId        DC.L    'Apple Computer'                    ;The Vendor Id
  106. _RevLevel        DC.L    'Beta-7.0'                            ;The Revision Level
  107. _PartNum        DC.L    'TFB-1'                                ;The Part Number
  108.  
  109.  
  110. ;=============================================================
  111. ;            sRsrc_Video
  112. ;=============================================================
  113. _sRsrc_Video    OSLstEntry    sRsrcType,_VideoType            ;References the sResource Type.
  114.                 OSLstEntry    sRsrcName,_VideoName            ;References the sResource Name.
  115.                 OSLstEntry    sRsrcDrvrDir,_VidDrvrDir        ;References the driver directory.
  116.                 DatLstEntry    sRsrcHWDevId,1                    ;The hardware device Id.
  117.  
  118.                 OSLstEntry    MinorBaseOS,_MinorBase            ;References the Minor Base Offset.
  119.                 OSLstEntry    MinorLength,_MinorLength        ;References the Minor Base Length.
  120.  
  121. ;Parameters
  122.                 OSLstEntry    OneBitMode,_OneBitMode            ;References the one-bit mode parameters.
  123.                 OSLstEntry    TwoBitMode,_TwoBitMode            ;References the two-bit mode parameters.
  124.                 OSLstEntry    FourBitMode,_FourBitMode        ;References the three-bit mode parameters.
  125.  
  126.                 DatLstEntry    endOfList,0                        ;End of the list.
  127.  
  128.  
  129. _VideoType        DC.W    CatDisplay                            ;Video sResource :    <Category>
  130.                 DC.W    TypVideo                            ;                    <Type>
  131.                 DC.W    DrSwApple                            ;                    <DrvrSw>
  132.                 DC.W    DrHwTFB                                ;                    <DrvrHw>
  133.  
  134. _VideoName        DC.L    'Display_Video_Apple_TFB'            ;Convention: _VideoName is derived by
  135.                                                             ;using _VideoType above, but stripping
  136.                                                             ;off the Cat,Typ, and DrSw/Hw prefixes, then
  137.                                                             ;separating by underscores
  138.  
  139. _MinorBase        DC.L    defMinorBase                        ;Video RAM Offset is 0
  140. _MinorLength    DC.L    defMinorLength                        ;Video RAM length is $40000
  141.  
  142.  
  143.  
  144. ;-------------------------------------------------------------
  145. ;                Driver directory
  146. ;-------------------------------------------------------------
  147. _VidDrvrDir        OSLstEntry    sMacOS68020,_sMacOS68020        ;References the Macintosh-OS 68020 driver.
  148.                 DatLstEntry    endOfList,0                        ;End of the list.
  149.  
  150.  
  151. ;Driver-1 (68020).
  152. _sMacOS68020    DC.L    _End020Drvr-_sMacOS68020            ;The physical Block Size
  153.                 INCLUDE    'C & D Ex Drvr.a'                    ;The Header/Code (See TFBDrvr.a)
  154. _End020Drvr        EQU        *                                    ;The end of the driver.
  155.                 STRING     C
  156.  
  157.  
  158. ;-------------------------------------------------------------
  159. ;                One-Bit per pixel parameter list.
  160. ;-------------------------------------------------------------
  161. _OneBitMode        OSLstEntry    mVidParams,_OneVidParams        ;References the one-bit mode parameter record.
  162.                 DatLstEntry    mPageCnt,4                        ;The page count.
  163.                 DatLstEntry mDevType,defmDevType            ;The device type.
  164.                 DatLstEntry    endOfList,0                        ;End of the list.
  165.  
  166.  
  167. _OneVidParams    DC.L    _EndOneVParams-_OneVidParams        ;The physical Block Size.
  168.  
  169.                 DC.L    defmBaseOffset    
  170.                 DC.W    1024/8                                ;Bounds.R*PixelSize/8
  171.                 DC.W    defmBounds_T,defmBounds_L,defmBounds_B,defmBounds_R
  172.                 DC.W    defVersion                            ;bmVersion
  173.                 DC.W    0                                    ;packType not used
  174.                 DC.L    0                                    ;packSize not used
  175.                 DC.L    defmHRes                            ;bmHRes
  176.                 DC.L    defmVRes                            ;bmVRes
  177.                 DC.W    defPixelType                        ;bmPixelType
  178.                 DC.W    1                                    ;bmPixelSize
  179.                 DC.W    defCmpCount                            ;bmCmpCount
  180.                 DC.W    1                                    ;bmCmpSize
  181.                 DC.L    defmPlaneBytes                        ;bmPlaneBytes
  182.                 
  183. _EndOneVParams    EQU        *                                    ;End of block.
  184.  
  185.  
  186. ;-------------------------------------------------------------
  187. ;                TWO-Bit per pixel parameter list.
  188. ;-------------------------------------------------------------
  189. _TwoBitMode        OSLstEntry    mVidParams,_TwoVidParams        ;References the two-bit mode parameter record.
  190.                 DatLstEntry    mPageCnt,2                        ;The page count.
  191.                 DatLstEntry mDevType,defmDevType            ;The device count.
  192.                 DatLstEntry    endOfList,0                        ;End of the list.
  193.  
  194. _TwoVidParams    DC.L    _EndTwoVParams-_TwoVidParams        ;Physical Block Size.
  195.  
  196.                 DC.L    defmBaseOffset    
  197.                 DC.W    1024*2/8                            ;Bounds.R*PixelSize/8
  198.                 DC.W    defmBounds_T,defmBounds_L,defmBounds_B,defmBounds_R
  199.                 DC.W    defVersion                            ;bmVersion
  200.                 DC.W    0                                    ;packType not used
  201.                 DC.L    0                                    ;packSize not used
  202.                 DC.L    defmHRes                            ;bmHRes
  203.                 DC.L    defmVRes                            ;bmVRes
  204.                 DC.W    defPixelType                        ;bmPixelType
  205.                 DC.W    2                                    ;bmPixelSize
  206.                 DC.W    defCmpCount                            ;bmCmpCount
  207.                 DC.W    2                                    ;bmCmpSize
  208.                 DC.L    defmPlaneBytes                        ;bmPlaneBytes
  209.                 
  210. _EndTwoVParams    EQU        *                                    ;End of block.
  211.  
  212.  
  213. ;-------------------------------------------------------------
  214. ;                Four-Bit per pixel parameter list.
  215. ;-------------------------------------------------------------
  216. _FourBitMode    OSLstEntry    mVidParams,_FourVidParams        ;References the four-bit mode parameter record.
  217.                 DatLstEntry    mPageCnt,1                        ;The page count.
  218.                 DatLstEntry mDevType,defmDevType            ;The device type.
  219.                 DatLstEntry    endOfList,0                        ;End of the list.
  220.  
  221. _FourVidParams    DC.L    _EndFourVParams-_FourVidParams        ;Physical Block Size.
  222.  
  223.                 DC.L    defmBaseOffset    
  224.                 DC.W    1024*4/8                            ;Bounds.R*PixelSize/8
  225.                 DC.W    defmBounds_T,defmBounds_L,defmBounds_B,defmBounds_R
  226.                 DC.W    defVersion                            ;bmVersion
  227.                 DC.W    0                                    ;packType not used
  228.                 DC.L    0                                    ;packSize not used
  229.                 DC.L    defmHRes                            ;bmHRes
  230.                 DC.L    defmVRes                            ;bmVRes
  231.                 DC.W    defPixelType                        ;bmPixelType
  232.                 DC.W    4                                    ;bmPixelSize
  233.                 DC.W    defCmpCount                            ;bmCmpCount
  234.                 DC.W    4                                    ;bmCmpSize
  235.                 DC.L    defmPlaneBytes                        ;bmPlaneBytes
  236.                 
  237. _EndFourVParams    EQU        *                                    ;End of block.
  238.  
  239.  
  240.  
  241.  
  242.                 ORG     ROMSize-FHeaderRec.fhBlockSize
  243. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  244. ;            Format/Header Block
  245. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  246.                 DC.L    (_sRsrcDir-*)**$00FFFFFF            ;Offset to sResource directory
  247.                 DC.L    ROMSize                                ;Length of declaration data
  248.                 DC.L    0                                    ;CRC {Patched by crcPatch (MPW tool)}
  249.                 DC.B    romRevision                            ;Revision level
  250.                 DC.B    AppleFormat                            ;Format
  251.                 DC.L    TestPattern                            ;Test pattern
  252.                 DC.B    0                                    ;Reserved byte (must be zero)
  253.                 DC.B    $E1                                    ;ByteLanes: 1110 0001 (bytelane 0)
  254.  
  255.  
  256.                 ENDP
  257.  
  258.             
  259.                 END
  260.  
  261.